package com.study.c3;

public class Student
{
    String name;
    int age;

    public Student(){}

    public Student(String name, int age)
    {
        this.name = name;
        this.age = age;
    }

    void setName(String name)
    {
        this.name = name;
    }

    String getName()
    {
        return this.name;
    }

    void setAge(int age)
    {
        this.age = age;
    }

    int getAge()
    {
        return age;
    }

    @Override
    public String toString()
    {
        return getName() + ", " + getAge();
    }

    public static void main(String[] args)
    {
        Student student = new Student();
        student.setName("张三");
        student.setAge(20);
        System.out.println(student);

        Student student2 = new Student("李四", 25);
        System.out.println(student2);
    }
}
